{% extends "toast/base.template.html" %}
{% load toast_filters %}


{% block breadcrumbs %}
	<li class="active">States</li>
{% endblock %}


{% block sidecontent %}
	<p class="lead">Register State</p>
	<form method="POST" action="/toast/state/add/">
	{% csrf_token %}
		<h6>{{ form.long_name.label }}</h6>
		{{ form.long_name }}
		<p class="text-error">{{ form.long_name.errors.as_text }}</p>

		<h6>{{ form.short_name.label }}</h6>
		{{ form.short_name }}
		<p class="text-error">{{ form.short_name.errors.as_text }}</p>

		<input class="btn btn-primary" type="submit" name="state_add" value="Register State" />
	</form>
{% endblock %}


{% block content %}
{% if list_of_states %}
	<table class="table">
		<thead>
		<tr>
			<th>Long Name</th>
			<th>Short Name</th>
			<th>Action(s)</th>
		</tr>
		</thead>
		<tbody>
		{% for state in list_of_states %}
		<tr>
			<td>{{ state.long_name|ucwords }}</td>
			<td>{{ state.short_name }}</td>
			<td>
			<div class="btn-group pull-right">
				<a class="btn btn-primary" href="#"><i class="icon-wrench icon-white"></i> Actions</a>
				<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
				<ul class="dropdown-menu">
					<li><a href="/toast/state/view/{{ state.id }}"><i class="icon-eye-open"></i> View</a></li>
					<li><a href="/toast/state/edit/{{ state.id }}"><i class="icon-pencil"></i> Edit</a></li>
					<li><a href="/toast/state/delete/{{ state.id }}" class="confirm" message="Are you sure you want to delete {{ state.long_name|ucwords }}?"><i class="icon-trash"></i> Delete</a></li>
				</ul>
			</div>
			<div class="clearfix"></div>
			</td>
		</tr>
		{% endfor %}
		</tbody>
	</table>
{% endif %}
{% endblock %}

